<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改任务')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-taskMission-edit" th:object="${taskTransfer}">
        <input id="transferId" name="transferId" type="hidden" th:field="*{transferId}"/>
        <input id="infoId" name="infoId" type="hidden" th:field="${taskTransfer.personInfo.infoId}">
        <div class="form-group">
            <label class="col-sm-3 control-label">任务标题：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="missionTitle" id="missionTitle" th:field="${taskTransfer.taskMission.missionTitle}" required readonly="true">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">任务执行人：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" th:field="${taskTransfer.personInfo.infoName}" required readonly="true">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">转移理由：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="postponeText" id="postponeText" th:field="${taskTransfer.transferReason}" required readonly="true">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">转移对象：</label>
            <div class="col-sm-8">
                <select name="toId"  class="form-control" id="toId">
                    <option th:each="person : ${list}" th:value="${person.infoId}" th:text="${person.infoName}" th:selected="${person.infoId eq taskTransfer.toId}" readonly="true"></option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">是否批准：</label>
            <div class="col-sm-9">

                <label class="radio-box">
                    <input type="radio"
                           th:checked="${taskTransfer.auditState eq '0'}"
                           id="option1" name="auditState" value="0" style="position: absolute; opacity: 0;">
                   不批准
                </label>

                <label class="radio-box">
                    <input type="radio"
                           th:checked="${taskTransfer.auditState eq '1'}"
                           id="option2" name="auditState"  value="1" style="position: absolute; opacity: 0;">
                    批准
                </label>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "task/transferRatify";

    $("#form-taskMission-edit").validate({
        onkeyup: false,
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-taskMission-edit').serialize());
        }
    }
</script>
</body>
</html>
